import {baseUrl} from '../common/js/config.js'
console.log(baseUrl)
export function Get(url,param = {}) {
	return new Promise((resolve, reject) => {
		uni.request({
			url: baseUrl + url,
			data: param,
			success: (res) => {
				resolve(res.data)
			},
			fail: (err) => {
				reject(err)
			}
		});
	})
}

// {'content-type':'application/x-www-form-urlencoded'}
export function Post(url,param = {},header = {'content-type':'application/json'}) {
	return new Promise((resolve,reject) => {
		uni.request({
			url: baseUrl + url,
			data: param,
			method:'POST',
			header: header,
		  success: (res) => {
				resolve(res.data)
		  },
			fail: (err) => {
				reject(err)
			}
		});
	})
}
